#!/bin/bash
#program:
#		use loop to calculate "1+2+3..+n" result.
#History:
#		2013/7/25	Leaguenew first release

s=0
i=0

read -p "Please input the number n:"  n

while [ "$i" != "$n" ]
do
	i=$(($i+1))
	s=$(($s+$i))	
done

echo "The result of '1+2+3..+n' is  ==> $s "

